package cn.iocoder.yudao.module.shop.dal.mysql.orderfeedback;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.orderfeedback.ShopOrderFeedbackDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.orderfeedback.vo.*;

/**
 * 顾客订单反馈 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopOrderFeedbackMapper extends BaseMapperX<ShopOrderFeedbackDO> {

    default PageResult<ShopOrderFeedbackDO> selectPage(ShopOrderFeedbackPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopOrderFeedbackDO>()
                .eqIfPresent(ShopOrderFeedbackDO::getMasterId, reqVO.getMasterId())
                .eqIfPresent(ShopOrderFeedbackDO::getConfirmed, reqVO.getConfirmed())
                .betweenIfPresent(ShopOrderFeedbackDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ShopOrderFeedbackDO::getMemberId, reqVO.getMemberId())
                .orderByDesc(ShopOrderFeedbackDO::getId));
    }

    default List<ShopOrderFeedbackDO> selectList(ShopOrderFeedbackExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopOrderFeedbackDO>()
                .eqIfPresent(ShopOrderFeedbackDO::getMasterId, reqVO.getMasterId())
                .eqIfPresent(ShopOrderFeedbackDO::getConfirmed, reqVO.getConfirmed())
                .betweenIfPresent(ShopOrderFeedbackDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ShopOrderFeedbackDO::getMemberId, reqVO.getMemberId())
                .orderByDesc(ShopOrderFeedbackDO::getId));
    }

}
